	var dialogUid = 0;
	var dialog = function( title,width,height,dom ){
			this.uid = ++dialogUid;
			this.title = title;
			this.width = width;
			this.height = height;
			this.dom = dom;
			this._contentHTML = "<div class=\"D\">"
									+"<div class=\"bg\"></div>"
									+"<div class=\"CR\" id=\"main\">"
										+"<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"tbSendMsg\" style=\"width:100%;\">"
											+"<tbody>"
												+"<tr>"
													+"<td class=\"tl\"></td>"
													+"<td class=\"tm\"></td>"
													+"<td class=\"tr\"></td>"
												+"</tr>"
												+"<tr>"
													+"<td class=\"lm\"></td>"
													+"<td>"
														+"<div class=\"DWrap\">"
															+"<div class=\"DTitle\" style=\"background:white;font-size:14px;font-weight:bold;overflow:hidden;margin:-14px -14px 0;padding:14px 0 0 14px;\"><h1 id=\"title\" style=\"height:29px;font-size:14px;padding-left:25px;margin:-8px 7px 0px -8px;line-height:29px;font-weight:bold;background:#f0f0f0;\"></h1></div>"
															+"<a href=\"#\" class=\"DClose close\" id=\"closeBtn\" title=\"关闭\">关闭</a>"
															+"<div class=\"DLoad\"></div>"
															+"<div class=\"DCont\" id=\"dialogcontent\">"
															+"</div>"
														+"</div>"
													+"</td>"
													+"<td class=\"rm\"></td>"
												+"</tr>"
												+"<tr>"
													+"<td class=\"bl\"></td>"
													+"<td class=\"bm\"></td>"
													+"<td class=\"br\"></td>"
												+"</tr>"
											+"</tbody>"
										+"</table>"
									+"</div>"
								+"</div>";
			this.init();
		};
		
	dialog.prototype.setTitle = function( title ){
			this.title = title;
		};
	dialog.prototype.setDOM = function(dom){
			this.dom = dom;
		};
	dialog.prototype.setWidth = function(w){
			this.width = w;
		};
	dialog.prototype.setHeight = function(h){
			this.height = h;
		};
	dialog.prototype.init = function(){
			var _this = this;
			var dialogobj = $(_this._contentHTML);
			dialogobj.css("height",$("body").height()+"px");
			dialogobj.attr("id","dialog"+_this.uid);
			dialogobj.find("#dialogcontent").css({
					"height":_this.height+"px"
			});
			if((typeof _this.dom).toLowerCase()== "string"){
				dialogobj.find("#dialogcontent").append($(_this.dom));
				
			}else{
				dialogobj.find("#dialogcontent").append(_this.dom);
				
			}
			dialogobj.find("#main").css({
				"width":_this.width+"px",
				"margin-top":-_this.height+"px",
				"margin-left":-_this.width/2+"px"
			});
			dialogobj.find("#title").text(_this.title);
			$("body").append(dialogobj);
			dialogobj.find("#closeBtn").click(function(){
				_this.remove();
			})
			_this.dialogObj = dialogobj;
		};
	dialog.prototype.show = function(){
			this.dialogObj.show();
		};
	dialog.prototype.hide = function(){
			this.dialogObj.hide();
		};
	dialog.prototype.remove = function(){
			this.dialogObj.remove();
		};